#ifndef _INPUTMGR_H
#define _INPUTMGR_H

#define NULL 0

enum KEY
{
	KEY_W = 0,
	KEY_A,
	KEY_S,
	KEY_D,
	KEY_COUNT
};

class InputMgr
{
public:
	static InputMgr *Create()
	{
		if(g_instance == NULL)
		{
			g_instance = new InputMgr();
		}
		return g_instance;
	}
	static InputMgr *Get()
	{
		return g_instance;
	}
	static void Delete()
	{
		delete g_instance;
		g_instance = NULL;
	}

	void SetMouseMovement(float x, float y);
	void SetMouseDown(bool state){ m_mouseDown = state; }
	void SetKeyState(KEY key, bool state);
	void ClearMouseMovement();

	bool GetKeyState(KEY key){ return m_keys[key]; }
	float GetMouseX(){ return m_mouseX; }
	float GetMouseY(){ return m_mouseY; }
	bool GetMouseDown(){ return m_mouseDown; }

private:
	InputMgr(); // Singleton
	static InputMgr *g_instance;
	bool m_keys[KEY_COUNT];

	float m_mouseX;
	float m_mouseY;
	bool m_mouseDown;
};

#endif